extends Sprite2D

@onready var area_2d: Area2D = $Area2D

var can_touch : bool = false

signal change_the_window

#连这里！！
func _physics_process(delta: float) -> void:
	if Input.is_action_just_pressed("conect") and can_touch:
		change_the_window.emit()
		area_2d.queue_free()


func _on_area_2d_body_entered(body: Node2D) -> void:
	can_touch = true


func _on_area_2d_body_exited(body: Node2D) -> void:
	can_touch = false
